package top.dark.design.patterns.decorator;

/**
 * Author: Darkn
 * description:
 * Create Time: 2021/4/27 11:02
 */
public class Client {
    public static void main(String[] args) {
        // 装饰者模式下的订单：2份牛奶+一份soy的单品咖啡
        Drink order1 = new ShortBlack();
        System.out.println("单品咖啡的描述：" + order1.getDescription());
        System.out.println("单品咖啡的价格：" + order1.cost());

        order1 = new Milk(order1);
        System.out.println("单品咖啡+一份牛奶的描述：" + order1.getDescription());
        System.out.println("单品咖啡+一份牛奶的价格：" + order1.cost());

        order1 = new Milk(order1);
        System.out.println("单品咖啡+2份牛奶的描述：" + order1.getDescription());
        System.out.println("单品咖啡+2份牛奶的价格：" + order1.cost());
    }
}
